//
//  MineViewController.m
//  壳牌喜力促销积分商城
//
//  Created by xrd on 15/3/16.
//  Copyright (c) 2015年 xrd. All rights reserved.
//

#import "MineViewController.h"


#import"MyOderTableController.h"
#import"CuXiaoViewController.h"
#import"XIuGaiViewController.h"
#import"peiSongViewController.h"



@interface MineViewController ()

@property(nonatomic,copy) NSString *iconView;//头像
@property(nonatomic,copy) NSString *nameLabel; //名字
@property(nonatomic,copy) NSString *ScoreLabel;//积分
@property (weak, nonatomic) IBOutlet UIView *topView;//顶部的 个人信息View
@property (nonatomic,strong)NSArray *dataArray;//4个cell 的标题


@end

@implementation MineViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    rect = [[UIScreen mainScreen] bounds];
    size = rect.size;
    width = size.width;
    height = size.height;

//    self.title = @"我";
    _dataArray =[ NSArray arrayWithObjects:@"我的订单",@"促销机制",@"密码修改",@"配送地址",nil];
    
    //设置下面的mytableView
   myTableView =  [[UITableView alloc]initWithFrame:CGRectMake(0, _topView.frame.origin.y+_topView.frame.size.height, width, 176) style:UITableViewStylePlain];
    myTableView.scrollEnabled = NO;
    myTableView.delegate  = self;
    myTableView.dataSource =  self;
    [self.view addSubview:myTableView];
    

}




-(void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;

}
- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear: YES];
//   self.navigationController.navigationBarHidden = YES;
    

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



#pragma mark - 数据源

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return  self.dataArray.count;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{

static NSString *ID = @"cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil)
    {
    
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        NSUInteger row = [indexPath row];
        cell.textLabel.text =  [self.dataArray objectAtIndex:row];
//        cell.imageView.image = 
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        
    }
       return cell;
 }



#pragma mark - 代理

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
//    NSUInteger row = [indexPath row];
    
    

    
    
    long row=[indexPath row];
    if (row==0) {
        MyOderTableController *myOder=[[MyOderTableController alloc]init];
        myOder.hidesBottomBarWhenPushed=YES;

        [self.navigationController pushViewController:myOder animated:YES];
        
    }else if (row==1){
        CuXiaoViewController *CuXiaoVC=[[CuXiaoViewController alloc]init];
        CuXiaoVC.hidesBottomBarWhenPushed=YES;

        [self.navigationController pushViewController:CuXiaoVC animated:YES];
        
    }else if (row==2){
        XIuGaiViewController *XIuGai=[[XIuGaiViewController alloc]init];
        XIuGai.hidesBottomBarWhenPushed=YES;

        [self.navigationController pushViewController:XIuGai animated:YES];
        
    }else if (row==3){
        
        
        peiSongViewController *peiSong=[[peiSongViewController alloc]init];
      peiSong.hidesBottomBarWhenPushed=YES;
        [self.navigationController pushViewController:peiSong animated:YES];
        
//
    }
    
    
    
}

//- (IBAction)oderBtn:(UIButton *)sender {
//    WLViewController *vc = [[WLViewController alloc]init];
//    
//    vc.view.backgroundColor = [UIColor whiteColor];
//    vc.title = @"物流详情";
//    
//    [self.navigationController pushViewController:vc animated:YES];
//    
//    
//                       
//}
@end
